package com.xiaopengpeng.test;

import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;


public class PeopleRowMapper implements RowMapper<People>{
	private static byte[] COLUMNFAMILY = "f".getBytes();
    private static byte[] NAME = "name".getBytes();
    private static byte[] AGE = "age".getBytes();
	@Override
	public People mapRow(Result result) {
		People people = new People();
        // TODO: 设置相关的属性值
        String name = Bytes.toString(result.getValue(COLUMNFAMILY, NAME));
        int age = Bytes.toInt(result.getValue(COLUMNFAMILY, AGE));
		return people.setName(name).setAge(age);
	}
	@Override
	public Put mapPut(People bean) {
		// TODO Auto-generated method stub
		return null;
	}
	

}
